//
//  LGCustomTextMessageCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/3/23.
//  文字

#import "LGCustomTextMessageCell2.h"



@implementation LGCustomTextMessageCell2

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:self.contentLabel];
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(viewPix(5));
            make.bottom.centerX.equalTo(self.contentView);
            make.width.equalTo(@(Screen_W-viewPix(80)));
        }];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    [super setDataDic:dataDic];
    NSDictionary *contentDic = [ObjectTool jsonToObject:dataDic[@"content"][@"ext"]];
    self.contentLabel.text = contentDic[@"msgcontent_doctor"][@"content"];
    CGFloat topMargin = [LGNSString(dataDic[@"showTime"]) isEqualToString:@"Y"]?viewPix(5)+20:0;
    [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(viewPix(5)+topMargin);
    }];
}



@end
